package com.wwwarehouse.taskcenter.adapter.job_point;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.AbsListView;

import com.wwwarehouse.common.adapter.media.CommonAdapter;
import com.wwwarehouse.common.adapter.media.ViewHolder;
import com.wwwarehouse.taskcenter.R;
import com.wwwarehouse.taskcenter.bean.job_point.JobPointRuleTemplateResponseBean;

import java.util.List;

/**
 * Created by Jackie on 2017/10/30.
 * 作业点模板 适配器
 */

public class TemplateAdapter extends CommonAdapter<JobPointRuleTemplateResponseBean.JobPointTemplateDetailsBean> {
    private int mItemHeight;


    public TemplateAdapter(Context context, int layoutId, List<JobPointRuleTemplateResponseBean.JobPointTemplateDetailsBean> list, int itemHeight) {
        super(context, layoutId, list);

        this.mItemHeight = itemHeight;
    }

    @Override
    public void convert(ViewHolder holder, final JobPointRuleTemplateResponseBean.JobPointTemplateDetailsBean jobPointTemplateDetailsBean) {
        AbsListView.LayoutParams params = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        params.height = mItemHeight;
        holder.getConvertView().setLayoutParams(params);


        holder.setText(R.id.tv_name, jobPointTemplateDetailsBean.getTempDesc());
    }
}
